//
//  UIButton+YSExtension.m
//  yisu
//
//  Created by 花花 on 16/10/31.
//  Copyright © 2016年 花花. All rights reserved.
//

#import "UIButton+HHExtension.h"

@implementation UIButton (HHExtension)
+(instancetype)buttontitle:(NSString *)title frame:( CGRect)frame target:(id)target action:(SEL)action{

    UIButton *btn =[UIButton buttonWithType:UIButtonTypeCustom];
    [btn setTitle:title forState:UIControlStateNormal];
    
    [btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
//    [btn setBackgroundColor:[UIColor colorWithHexString:@"fa2850"]];
//    btn.layer.cornerRadius =5.0;
//    btn.layer.masksToBounds = YES;
    [btn setFrame:frame];
    [btn addTarget:target  action:action forControlEvents:UIControlEventTouchUpInside];
    
    return btn;

}

//
//-(void)commonInit{
//    self.titleLabel.textAlignment = NSTextAlignmentCenter;
//    self.imageView.contentMode = UIViewContentModeScaleAspectFit;
//    self.titleLabel.font = [UIFont systemFontOfSize:12];
//}

//- (CGRect)titleRectForContentRect:(CGRect)contentRect{
//    CGFloat titleX = 0;
//    CGFloat titleY = contentRect.size.height * 0.65;
//    CGFloat titleW = contentRect.size.width;
//    CGFloat titleH = contentRect.size.height - titleY;
//    return CGRectMake(titleX, titleY, titleW, titleH);
//}
//
//- (CGRect)imageRectForContentRect:(CGRect)contentRect{
//    CGFloat imageW = CGRectGetWidth(contentRect);
//    CGFloat imageH = contentRect.size.height * 0.4;
//    return CGRectMake(0, 5, imageW, imageH);
//}

@end
